From 388f820bfc073efb4f66c1aa2394fa5a4b8a8709 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 23 Feb 2023 15:47:31 -0800 Subject: show tips for sender --- .../[username]/invoice/[hash]/paid/+page.svelte | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/routes/(app)/[username]') diff --git a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte index 432b137a..3a281728 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte @@ -4,7 +4,7 @@ import { toast } from '@zerodevx/svelte-toast'; import { browser } from '$app/environment'; import { t } from '$lib/translations'; - import { f, s, sat, sats } from '$lib/utils'; + import { fiat, f, s, sat, sats } from '$lib/utils'; import { goto } from '$app/navigation'; export let data; @@ -12,10 +12,6 @@ $: data && ({ amount, currency, rate, received, pending, tip, user, id } = data.invoice); toast.pop(0); - - $: amountFiat = parseFloat((((received - tip) * rate) / sats).toFixed(2)); - $: pendingFiat = parseFloat((((pending - tip) * rate) / sats).toFixed(2)); - $: tipFiat = parseFloat(((tip * rate) / sats).toFixed(2));
@@ -25,15 +21,20 @@ {#if received}

{$t('invoice.paymentSuccessful')}

- {f(amountFiat, currency)} + {f(fiat(received - tip, rate), currency)} {#if tip} - + {f(tipFiat, currency)} + + + {f(fiat(tip, rate), currency)} + {/if}

- {sat(received - tip)} + ⚡️{s(received - tip)} + {#if tip} - +{sat(tip)} + + + ⚡️{s(tip)} + {/if}

{/if} @@ -41,15 +42,17 @@ {#if pending}

Payment detected

- {f(pendingFiat, currency)} + {f(fiat(pending, rate), currency)} {#if tip} - + {f(tipFiat, currency)} + + {f(fiat(tip, rate), currency)} {/if}

- {sat(pending - tip)} + ⚡️{s(pending - tip)} {#if tip} - +{sat(tip)} + + + ⚡️{s(tip)} + {/if}

{/if} -- cgit v1.2.3